using Common.Enumerations;
using Newtonsoft.Json;
using PetaPoco;
using Sanelib.DataView;

namespace Common.Views
{
    [TableName("AccountView")]
    public class AccountView : AuditedView
    {
        [JsonIgnore]
        public AccountType AccountType { get; set; }
        public string AccountTypeValue { get { return AccountType == null ? "" : AccountType.Value; } set { AccountType = AccountType.FromValue(value); } }
        public string AccountTypeName { get { return AccountType == null ? "" : AccountType.DisplayName; } set { AccountType = AccountType.FromDisplay(value); } }
        public string AccountNumber { get; set; }
        [JsonIgnore]
        public Industry Industry { get; set; }
        public string IndustryTypeValue { get { return Industry == null ? "" : Industry.Value; } set { Industry = Industry.FromValue(value); } }
        public string IndustryName { get { return Industry == null ? "" : Industry.DisplayName; } set { Industry = Industry.FromDisplay(value); } }
        public string BillingStreet { get; set; }
        public string BillingCity { get; set; }
        public string BillingState { get; set; }
        public string BillingPostalCode { get; set; }
        public string BillingCountry { get; set; }
        public decimal? BillingLatitude { get; set; }
        public decimal? BillingLongitude { get; set; }
        public string ShippingStreet { get; set; }
        public string ShippingCity { get; set; }
        public string ShippingState { get; set; }
        public string ShippingPostalCode { get; set; }
        public string ShippingCountry { get; set; }
        public decimal? ShippingLatitude { get; set; }
        public decimal? ShippingLongitude { get; set; }
        public string Phone { get; set; }
        public string Mobile { get; set; }
        public string Fax { get; set; }
        public string Website { get; set; }
        public string Email { get; set; }
    }
}
